﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace JTT809_2011_Service.JT809
{
    /// <summary>
    /// 下级平台
    /// 线程同步
    /// </summary>
    public class JT809InferoprManualResetEvent : IJT809ManualResetEvent
    {
        private ManualResetEvent ManualResetEvent;

        public JT809InferoprManualResetEvent()
        {
            ManualResetEvent = new ManualResetEvent(false);
        }
        /// <summary>
        /// 等待10秒
        /// </summary>
        public void Pause()
        {
            ManualResetEvent.WaitOne(TimeSpan.FromSeconds(10));
        }

        public bool Reset()
        {
            return ManualResetEvent.Reset();
        }

        public bool Resume()
        {
            return ManualResetEvent.Set();
        }
    }
}
